﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Manon.Core.Commons
{
    internal class PagedList
    {
        /// <summary>
        /// 当前页 值
        /// </summary> 
        public int PageIndex { get; set; }
        /// <summary>
        /// 每页大小
        /// </summary> 
        public int PageSize { get; set; }
        /// <summary>
        /// 数据总数
        /// </summary> 
        public long TotalCount { get; set; }
        /// <summary>
        /// 总页数
        /// </summary> 
        public int TotalPages { get; set; }
        /// <summary>
        /// 起始页 值
        /// </summary> 
        public int IndexFrom { get; set; }
        /// <summary>
        /// 当前页数据
        /// </summary> 
        public object Items { get; set; }
         
        /// <summary>
        /// 是否有上一页
        /// </summary> 
        public bool HasPreviousPage
        {
            get
            {
                return PageIndex - IndexFrom > 0;
            }
            set { }
        }
        /// <summary>
        /// 是否有下一页
        /// </summary> 
        public bool HasNextPage
        {
            get
            {
                return PageIndex - IndexFrom + 1 < TotalPages;
            }
            set { }
        }
    }
}
